'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  //把数据推送到数据库
  router.get('/', controller.home.index);

  //登录
  router.post('/api/login', controller.home.login)

  //注册
  router.post('/api/register', controller.home.register)

  //渲染热点
  router.post('/api/getList', controller.home.getList)

  //渲染睡眠
  router.post('/api/shuiList', controller.home.shuiList)

  //渲染生活
  router.post('/api/shengList', controller.home.shengList)

  //渲染话题
  router.post('/api/huaList', controller.home.huaList)

  //渲染男性
  router.post('/api/nanList', controller.home.nanList)

  //热点搜索
  router.post('/api/search', controller.home.search)

  //话题搜索
  router.post('/api/search1', controller.home.search1)

  //商城渲染
  router.post('/api/xinxuan', controller.home.xinxuan)

  //美洽渲染
  router.post('/api/haoping', controller.home.haoping)

  //商品列表详情
  router.post('/api/detail', controller.home.detail)

  //渲染商品列表
  router.post('/api/giftList', controller.home.giftList)

  //添加购物车--商品详情
  router.post('/api/addShopCar', controller.home.addShopCar)

  //购物车渲染
  router.post('/api/shopcar', controller.home.shopcar)

  //购物车删除
  router.post('/api/shopcardel', controller.home.shopcardel)

  //添加购物车--列表详情
  router.post('/api/addShopCars', controller.home.addShopCars)

  //热点详情
  router.post('/api/rddetail', controller.home.rddetail)

  //话题筛选
  router.post('/api/shai',controller.home.shai)
};
